package com.csii.excelapp.service;

import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.sql.DataSource;

@Configuration
public class MybatisConfig {

//    @Bean
//    public SqlSessionFactoryBean newSqlSessionFactoryBean(DataSource dataSource) {
//        SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
//        org.apache.ibatis.session.Configuration configuration = new org.apache.ibatis.session.Configuration();
//        configuration.setCallSettersOnNulls(true);
//        bean.setConfiguration(configuration);
//        bean.setDataSource(dataSource);
//        return bean;
//    }
}
//@Bean
//public SqlSessionFactory sqlSessionFactory(DataSource dataSource, MybatisProperties mybatisProperties) throws Exception {
//    SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
//    sqlSessionFactoryBean.setDataSource(dataSource);
//    //注入MybatisProperties,设置Configuration
//    sqlSessionFactoryBean.setConfiguration(mybatisProperties.getConfiguration());
//    return sqlSessionFactoryBean.getObject();
//}
//}
//
//
